<!DOCTYPE html>
<html>

	<head>
		<meta charset="UTF-8">
		<title>预存路线</title>
		<meta name="viewport" content="initial-scale=1.0, maximum-scale=1.0, user-scalable=no" />
		<meta name="misapplication-tap-highlight" content="no" />
		<meta name="HandheldFriendly" content="true" />
		<meta name="MobileOptimized" content="320" />
		<link rel="stylesheet" type="text/css" href="iconfont/iconfont.css" />
		<link rel="stylesheet" type="text/css" href="css/all_css.css" />
		<link rel="stylesheet" type="text/css" href="css/weui/base.css" />
		<link rel="stylesheet" type="text/css" href="lib/weui.css" />
		<link rel="stylesheet" type="text/css" href="css/weui/jquery-weui.css" />
		<link rel="stylesheet" type="text/css" href="css/KGbtn.css" />
		<style type="text/css">
			#ycxl_main {
				max-width: 640px;
				min-width: 320px;
				width: 100%;
				margin: 0px auto;
			}
			
			.index_head {
				/*position: static;*/
				z-index: 9;
			}
			
			.app_head_left {
				float: left;
				width: 15%;
				padding-left: 6px;
				padding-top: 6px;
			}
			
			.app_head_left a {
				color: #FFFFFF;
				font-size: 1.5em;
				font-weight: bold;
			}
			
			.app_head_mid {
				float: left;
				width: 70%;
				padding-top: 5px;
			}
			
			.app_head_right {
				float: right;
				width: 15%;
				text-align: right;
				padding: 10px;
				height: 10px;
			}
			
			.app_head_right img {
				height: 20px;
				margin-top: 3px;
				position: relative;
				left: 6px;
			}
			
			#app_head_title {
				text-align: center;
				color: #FFFFFF;
				font-size: 1.6em;
				font-family: "宋体";
				font-weight: bold;
			}
			
			.ycxl_mid {
				/*text-align: center;*/
				padding-top: 70px;
			}
			
			.ycxl_mid img {
				width: 40%;
				margin-top: 30px;
				margin-bottom: 30px;
				margin-left: 30%;
				margin-right: 30%;
			}
			/*----车站选择弹出层样式----*/
			
			#add_full {
				max-width: 640px;
				min-width: 320px;
				width: 100%;
				margin: 0px auto;
				overflow: hidden;
				position: static;
				z-index: 0;
			}
			
			#addycxl_tanchu {
				height: 100%;
				background-color: #FFFFFF;
				/*position: static;*/
			}
			
			#closeBtn i {
				color: #FFFFFF;
				font-size: 1.15em;
				position: relative;
				top: -6px;
				right: 8px;
			}
			
			.weui-row {
				background-color: #FFFFFF;
				padding-top: 70px;
			}
			
			.l_box {
				width: 100%;
			}
			
			.l_box label {
				display: inline-block;
				width: 63px;
				height: 30px;
			}
			
			.l_box .radio {
				height: 30px;
				line-height: 30px;
			}
			
			.l_box .radio input:nth-of-type(2) {
				margin-left: 30px;
			}
			
			.l_box #suggestId,
			.l_box #suggest {
				width: 60%;
				height: 30px;
				border: 1px solid #A5D2EC;
			}
			
			.l_box #times {
				margin-right: 50px;
			}
			
			.l_box #line_modle_finish {
				margin-right: 20px;
			}
			
			#hide_show {
				display: none;
				padding-bottom: 10px;
			}
			
			#tangram-suggestion--TANGRAM__1f-main {
				z-index: 99999999999;
				position: absolute !important;
			}
			
			#tangram-suggestion--TANGRAM__1z-main {
				z-index: 99999999999;
				/*position: absolute;*/
			}
			
			#suggestId_start,
			#suggestId_end {
				width: 64%;
				margin-left: 2%;
			}
			
			#suggestId_start {
				border-right-color: #F5F5F5;
			}
			
			.label_ {
				width: 10%;
				margin-left: 10%;
				font-size: 1.1em;
				color: #FFFFFF;
			}
			
			#suggestId_start,
			#suggestId_end,
			#datetime-picker {
				height: 50px;
				outline: none;
				border: 1px solid #D0D0D0;
				font-size: 1.1em;
				margin-right: 10%;
				padding-left: 1em;
				color: #666666;
				border-radius: 8px;
			}
			
			#suggestId_end {
				height: 40px;
				background-color: #000000;
				border: none;
				color: #F0F0F0;
			}
			
			#datetime-picker {
				width: 80%;
				margin-left: 10%;
				margin-top: 50px;
			}
			
			#suggestId_start {
				margin-top: 30px;
			}
			
			.close-picker {
				color: #0070B4 !important;
			}
			
			#add_full .toolbar-inner {
				position: fixed;
				top: 0;
				z-index: 9999;
				padding-top: 25px;
				height: 70px !important;
			}
			
			#KGbtnLi {
				height: 55px;
				margin-top: 25px;
				padding: 0 12%;
			}
			
			#KGbtnLi a {
				float: right;
				margin-right: 5%;
			}
			
			#KGbtnLi label {
				color: #999999;
				font-size: 1.2em;
				width: 50%;
				height: 100%;
				line-height: 54px;
				margin-left: 1em;
			}
			
			.inputType2 {
				width: 28%;
				height: 50px;
				outline: none;
				border: 1px solid #DEDEDE;
				font-size: 1.05em;
				padding-left: 1.3em;
				border-radius: 5px;
				position: relative;
				top: 30px;
				color: #666666;
			}
			
			#txNum {
				margin-left: 13%;
				margin-right: 14%;
			}
			
			#spaceTime {
				margin-right: 13%;
			}
			
			.input2_label {
				position: absolute;
				margin-top: 45px;
				margin-left: -26%;
				z-index: 999;
				color: #666666;
			}
			
			@media only screen and (max-width: 345px) {
				* {
					font-size: 0.8em;
				}
			}
			/*划分添加和已有的分隔线*/
			
			.fenge_hr {
				width: 80%;
				border: 1px solid #F5F5F5;
			}
			
			.myLogin {
				font-size: 1.1em;
				width: 25%;
				height: 35px;
				border-radius: 10px;
				display: block;
				background-color: #0070B4;
				text-align: center;
				line-height: 35px;
				margin-top: 20px;
				color: #FFFFFF;
				font-family: Tahoma, fzltxhk, "\5fae\8f6f\96c5\9ed1";
				margin-bottom: 60px;
			}
			
			.mt100 {
				margin-top: 100px !important;
			}
			
			.mycannotLogin {
				font-size: 1.1em;
				width: 25%;
				height: 35px;
				border-radius: 10px;
				display: block;
				background-color: #999999;
				text-align: center;
				line-height: 35px;
				color: #F5F5F5;
				font-family: Tahoma, fzltxhk, "\5fae\8f6f\96c5\9ed1";
				margin-top: 20px;
				margin-bottom: 60px;
			}
			
			.myPlaceSign {
				position: absolute;
				color: lightblue;
				font-size: 2.1em;
				margin-left: 10px;
				margin-top: -8px;
			}
			
			.myPlaceSign:active {
				color: lightblue;
			}
			
			.myPosition_span {
				width: 40%;
				margin-left: 40px;
				font-size: 1.2em;
				font-family: "黑体";
				color: lightblue;
			}
			
			.cannot,
			.canAdd {
				display: block;
				width: 40%;
				border-radius: 20px;
				height: 40px;
				line-height: 40px;
				margin-left: 30%;
				margin-right: 30%;
				font-family: Tahoma, fzltxhk, "\5fae\8f6f\96c5\9ed1";
				text-align: center;
				font-size: 1.2em;
				margin-top: 100px;
			}
			
			.cannot {
				background-color: #DCDCDC;
				color: #FFFFFF;
			}
			
			.canAdd {
				background-color: #0070B4;
				color: lawngreen;
			}
			
			.had_yclxUl {
				width: 100%;
				margin-top: 1px;
				border-top: 3px solid #DEDEDE;
				box-shadow: 2px 2px 2px #333333;
			}
			
			.had_yclxUl li {
				width: 94%;
				margin-left: 3%;
				border-bottom: 1px solid #DEDEDE;
				height: 60px;
				line-height: 59px;
				padding: 0 15px;
				color: #888888;
				white-space: nowrap;
				text-overflow: ellipsis;
				overflow: hidden;
			}
			
			.had_yclxUl li span:first-child {
				color: #0070B4;
			}
			
			.had_yclxUl li span:last-child {
				color: crimson;
				font-size: 1.15em;
			}
			
			.had_yclxUl_title {
				height: 50px;
				line-height: 50px;
				padding: 0 15px;
			}
			
			#yclx_addArea {
				background-image: url(img/my/yclx/add_ycl_bg.png);
				background-size: 100% 100%;
				box-shadow: 6px 6px 3px #888888;
				height: 100%;
				border-radius: 10px;
				width: 94%;
				margin-left: 3%;
			}
			
			.weui_dialog_ft .weui_btn_dialog:first-child {
				color: #F43530;
			}
			
			.weui_dialog_ft .weui_btn_dialog:last-child {
				color: #666666;
			}
			
			.alertSpanColGL {
				color: #0070B4;
			}
			/*提示框标题上的icon闹钟标志*/
			
			.nz_icon {
				width: 20px;
				margin-right: 3px;
				position: relative;
				top: 3px;
			}
			
			#del_yclxBtn {
				display: block;
				margin-top: 10px;
				height: 40px;
				text-align: center;
				line-height: 39px;
				color: #FFFFFF;
				border-radius: 8px;
				background-color: #F43530;
				width: 80%;
				font-family: Tahoma, fzltxhk, "\5fae\8f6f\96c5\9ed1";
				font-size: 1.2em;
				margin-bottom: 15px;
			}
		</style>
		<script src="js/common.js" type="text/javascript" charset="utf-8"></script>
		<script src="js/immersed.js" type="text/javascript" charset="utf-8"></script>
		<script type="text/javascript">
			var pushServer = "http://demo.dcloud.net.cn/push/?";
			var message = null;

			function createLocalPushMsg() {
				var options = {
					cover: false
				};
				var str = dateToStr(new Date());
				str += ": 欢迎您使用畅行吉林预存路线功能";
				plus.push.createMessage(str, "LocalMSG", options);
				outSet("创建本地消息成功！");
				outLine("请到系统消息中心查看！");
				if(plus.os.name == "iOS") {
					outLine('*如果无法创建消息，请到"设置"->"通知"中配置应用在通知中心显示!');
				}
			}
			// 监听plusready事件
			document.addEventListener("plusready", function() {
				message = document.getElementById("message");
				// 监听点击消息事件
				plus.push.addEventListener("click", function(msg) {
					// 判断是从本地创建还是离线推送的消息
					switch(msg.payload) {
						case "LocalMSG":
							outSet("点击本地创建消息启动：");
							break;
						default:
							outSet("点击离线推送消息启动：");
							break;
					}
					// 提示点击的内容
					plus.nativeUI.alert(msg.content);
					// 处理其它数据
					logoutPushMsg(msg);
				}, false);
				// 监听在线消息事件
				plus.push.addEventListener("receive", function(msg) {
					if(msg.aps) { // Apple APNS message
						outSet("接收到在线APNS消息：");
					} else {
						outSet("接收到在线透传消息：");
					}
					logoutPushMsg(msg);
				}, false);
			}, false);

			/**
			 * 日志输入推送消息内容
			 */
			function logoutPushMsg(msg) {
				outLine("title: " + msg.title);
				outLine("content: " + msg.content);
				if(msg.payload) {
					if(typeof(msg.payload) == "string") {
						outLine("payload(String): " + msg.payload);
					} else {
						outLine("payload(JSON): " + JSON.stringify(msg.payload));
					}
				} else {
					outLine("payload: undefined");
				}
				if(msg.aps) {
					outLine("aps: " + JSON.stringify(msg.aps));
				}
			}

			/**
			 * 获取本地推送标识信息
			 */
			function getPushInfo() {
				var info = plus.push.getClientInfo();
				outSet("获取客户端推送标识信息：");
				outLine("id: " + info.id);
				outLine("token: " + info.token);
				outLine("clientid: " + info.clientid);
				outLine("appid: " + info.appid);
				outLine("appkey: " + info.appkey);
			}
			/**
			 * 本地创建一条推动消息
			 */
			function createLocalPushMsg() {
				var options = {
					cover: false
				};
				var str = dateToStr(new Date());
				str += ": 欢迎使用HTML5+创建本地消息！";
				plus.push.createMessage(str, "LocalMSG", options);
				outSet("创建本地消息成功！");
				outLine("请到系统消息中心查看！");
				if(plus.os.name == "iOS") {
					outLine('*如果无法创建消息，请到"设置"->"通知"中配置应用在通知中心显示!');
				}
			}
			/**
			 * 读取所有推送消息
			 */
			function listAllPush() {
				var msgs = null;
				switch(plus.os.name) {
					case "Android":
						msgs = plus.push.getAllMessage();
						break;
					default:
						break;
				}
				if(!msgs) {
					outSet("此平台不支持枚举推送消息列表！");
					return;
				}
				outSet("枚举消息列表（" + msgs.length + "）：");
				for(var i in msgs) {
					var msg = msgs[i];
					outLine(i + ": " + msg.title + " - " + msg.content);
				}
			}
			/**
			 * 清空所有推动消息
			 */
			function clearAllPush() {
				plus.push.clear();
				outSet("清空所有推送消息成功！");
			}
			/**
			 * 请求‘简单通知’推送消息
			 */
			function requireNotiMsg() {
				if(navigator.userAgent.indexOf('StreamApp') > 0) {
					plus.nativeUI.toast('当前环境暂不支持发送推送消息');
					return;
				}
				var inf = plus.push.getClientInfo();
				var url = pushServer + 'type=noti&appid=' + encodeURIComponent(plus.runtime.appid);
				inf.id && (url += '&id=' + inf.id);
				url += ('&cid=' + encodeURIComponent(inf.clientid));
				if(plus.os.name == 'iOS') {
					url += ('&token=' + encodeURIComponent(inf.token));
				}
				url += ('&title=' + encodeURIComponent('Hello H5+'));
				url += ('&content=' + encodeURIComponent('欢迎回来体验HTML5 plus应用！'));
				url += ('&version=' + encodeURIComponent(plus.runtime.version));
				plus.runtime.openURL(url);
			}
			/**
			 * 请求‘打开网页’推送消息
			 */
			function requireLinkMsg() {
				if(navigator.userAgent.indexOf('StreamApp') > 0) {
					plus.nativeUI.toast('当前环境暂不支持发送推送消息');
					return;
				}
				var inf = plus.push.getClientInfo();
				var url = pushServer + "type=link&appid=" + encodeURIComponent(plus.runtime.appid);
				inf.id && (url += '&id=' + inf.id);
				url += ('&cid=' + encodeURIComponent(inf.clientid));
				if(plus.os.name == 'iOS') {
					url += ('&token=' + encodeURIComponent(inf.token));
				}
				url += ('&title=' + encodeURIComponent('HBuilder飞一样的编码'));
				url += ('&content=' + encodeURIComponent('看HBuilder如何追求代码编写速度的极致！立即去瞧一瞧？'));
				url += ('&url=' + encodeURIComponent('http://www.dcloud.io/'));
				url += ('&version=' + encodeURIComponent(plus.runtime.version));
				plus.runtime.openURL(url);
			}
			/**
			 * 请求‘下载链接’推送消息
			 */
			//			function requireDownMsg() {
			//				if(navigator.userAgent.indexOf('StreamApp') > 0) {
			//					plus.nativeUI.toast('当前环境暂不支持发送推送消息');
			//					return;
			//				}
			//				if(plus.os.name != "Android") {
			//					plus.nativeUI.alert("此平台不支持！");
			//					return;
			//				}
			//				var inf = plus.push.getClientInfo();
			//				var url = pushServer + 'type=down&appid=' + encodeURIComponent(plus.runtime.appid);
			//				inf.id && (url += '&id=' + inf.id);
			//				url += ('&cid=' + encodeURIComponent(inf.clientid));
			//				url += ('&title=' + encodeURIComponent('Hello H5+'));
			//				url += ('&content=' + encodeURIComponent('新版本发布了！立即下载体验？'));
			//				url += ('&ptitle=' + encodeURIComponent('Hello H5+'));
			//				url += ('&pcontent=' + encodeURIComponent('1. 优化用户体验;\n2. 修复在Android2.3.x某些设备可能异常退出的问题.'));
			//				url += ('&dtitle=' + encodeURIComponent('下载Hello H5+'));
			//				url += ('&durl=' + encodeURIComponent('http://www.dcloud.io/helloh5/HelloH5.apk'));
			//				url += ('&version=' + encodeURIComponent(plus.runtime.version));
			//				plus.runtime.openURL(url);
			//			}
			//			/**
			//			 * 请求‘透传数据’推送消息
			//			 */
			//			function requireTranMsg() {
			//				if(navigator.userAgent.indexOf('StreamApp') > 0) {
			//					plus.nativeUI.toast('当前环境暂不支持发送推送消息');
			//					return;
			//				}
			//				var inf = plus.push.getClientInfo();
			//				var url = pushServer + 'type=tran&appid=' + encodeURIComponent(plus.runtime.appid);
			//				inf.id && (url += '&id=' + inf.id);
			//				url += ('&cid=' + encodeURIComponent(inf.clientid));
			//				if(plus.os.name == 'iOS') {
			//					url += ('&token=' + encodeURIComponent(inf.token));
			//				}
			//				url += ('&title=' + encodeURIComponent('Hello H5+'));
			//				url += ('&content=' + encodeURIComponent('带透传数据推送通知，可通过plus.push API获取数据并进行业务逻辑处理！'));
			//				url += ('&payload=' + encodeURIComponent('{"title":"Hello H5+ Test","content":"test content","payload":"1234567890"}'));
			//				url += ('&version=' + encodeURIComponent(plus.runtime.version));
			//				plus.runtime.openURL(url);
			//			}
		</script>
		<script type="text/javascript" src="https://api.map.baidu.com/api?v=2.0&ak=MMh4H9m5FLBpizlht86GnGynuaM0oGKz"></script>
	</head>

	<body ontouchstart>
		<div id="ycxl_main">
			<div class="index_head">
				<div class="app_head_left">
					<a href="my.html" class="iconfont">&#xe6d4;</a>
				</div>
				<div class="app_head_mid">
					<p id="app_head_title">预存路线</p>
				</div>
				<div class="app_head_right">
					<img src="img/my/new_yclx.png" />
				</div>
			</div>
			<div class="ycxl_mid" id="ycxl_mid">
				<!--暂无预存的情况下的图片-->
				<img src="img/my/zanwuycxl.png" id="nullDataImg" />
				<div style="display: none;" class="had_yclxUl_title">我的出行计划</div>
				<ul class="had_yclxUl" id="had_yclxUl">
					<!--DOM JS添加-->
				</ul>
				<hr class="fenge_hr" />
				<div id="yclx_addArea" style="display: none;">
					<br /><br />
					<label class="label_">起点</label>
					<a class="iconfont myPlaceSign" id="myPlaceSign">&#xe6c9;</a><span class="myPosition_span">我的位置</span>
					<br/><br />
					<label class="label_">终点</label><input type="text" name="placeInput" onkeyup="addBtn_yanzheng(this)" id="suggestId_end" placeholder="请输入路线终点" />
					<br/><br/>
					<a style="display: none;" class="myLogin public-th open-popup" id="addToAlert" data-target="#add_full">添加</a>
					<span class="mycannotLogin mt20 mb50" id="cannotAddBtn">添加</span>
				</div>
			</div>
			<div id="add_full" class="weui-popup-container popup-bottom weui-popup-modal-visible">
				<div class="weui-popup-overlay yinying" id="yinying"></div>
				<div id="addycxl_tanchu" class="weui-popup-modal" onscroll="tanchuScroll(this)">
					<div class="toolbar">
						<div id="tanchu_head" class="toolbar-inner index_head">
							<div class="app_head_left">
								<a href="javascript:;" class="picker-button close-popup" id="closeBtn"><i class="iconfont">&#xe6d5;</i></a>
							</div>
							<div class="app_head_mid">
								<p id="app_head_title">添加线路及提醒</p>
							</div>
						</div>
						<div class="weui-row weui-no-gutter">
							<div class="l_box">

								<input type="text" id="datetime-picker" onclick="finishBtn()" placeholder="设定提醒时间" />
								<div id="l-map" style="display: none"></div>
								<!--<div id="searchResultPanel" style="border:1px solid #C0C0C0;width:150px;height:auto; display:none;"></div>-->
								<!--增加线路-->
								<!--<li id="timeSet">-->
								<!--日期选择器-->
								<!--</li>-->
								<li id="KGbtnLi">
									<!--控制单多次提醒开关-->
									<label>是否重复提醒</label>
									<a class="toggle toggle--on" id="KGbtn"></a>
								</li>
								<input type="number" disabled="disabled" class="inputType2" id="txNum" placeholder="提醒次数" />
								<input type="number" disabled="disabled" class="inputType2" id="spaceTime" placeholder="提醒间隔" />

								<a class="cannot">完成</a>
								<a class="canAdd" onclick="addYcxl()" style="display: none;" id="addFinishBtn">完成</a>
								<!--存至阿根后台以推送-->
							</div>
						</div>
					</div>
				</div>
			</div>
		</div>
		<!--<a class="ditem" onclick="createLocalPushMsg()">创建本地消息</a>-->
		<script src="js/jquery-1.11.0.js" type="text/javascript" charset="utf-8"></script>
		<script src="js/back_end.js" type="text/javascript" charset="utf-8"></script>
		<script src="js/md5.js" type="text/javascript" charset="utf-8"></script>
		<script src="js/weui/jquery-weui.js" type="text/javascript" charset="utf-8"></script>
		<script src="libs/crypto-js.js" type="text/javascript" charset="utf-8"></script>
		<script src="libs/aes.js" type="text/javascript" charset="utf-8"></script>
		<script src="libs/pad-zeropadding.min.js" type="text/javascript" charset="utf-8"></script>
		<script src="libs/encryption.js" type="text/javascript" charset="utf-8"></script>
		<script type="text/javascript">
			//save_line
			var userName = JSON.parse(localStorage.userJson)[0].username;
			$(function() {
				$.ajax({
					type: "post",
					url: Url,
					data: {
						"type": "save_line_info",
						"USERNAME": userName
					},
					async: false,
					cache: false,
					dataType: "jsonp", //数据类型为jsonp
					jsonp: "callbackparam", //服务端用于接收callback调用的function名的参数  
					jsonpCallback: "jsonpCallback1",
					success: function(data) {
						if(data.MSG == "成功") {
							var d = data.DATA;
							var m = data.MDATA;
							if(isEncrypt(d, m)) {
								console.log(d);
								if(d == "[]") {
									$("#nullDataImg").show();
									$(".app_head_right img").click();
								} else {
									$("#nullDataImg").hide();
									$(".had_yclxUl_title").show();
									d = eval(d); //倒序展示
									var time = d[0].REMIND_DATETIME.substr(0, 16);
									var place = d[0].ENDSTATION;
									var INTERVAL = d[0].REMIND_INTERVAL; //提醒间隔
									var NUMBER = d[0].REMIND_NUMBER; //重复次数
									var WHETHERMANY = d[0].WHETHER_MANY; //是否重复
									var id = d[0].RECID; //定时器的唯一标识
									var cf;
									if(WHETHERMANY == "false") {
										cf = "否";
									} else {
										cf = "是";
									}
									console.log(cf);
									var li1 = $('<li>提醒时间： <span>' + time + '</span></li>');
									var li2 = $('<li>目的地：去往<span>' + place + '</span></li>');
									var li3 = $('<li>重复提醒：<span>' + cf + '</span></li>');
									var li4 = $('<li>提醒次数：<span>' + NUMBER + '</span> 次</li>');
									var li5 = $('<li>提醒间隔：<span>' + INTERVAL + '</span> 分钟</li>');
									var li6 = $('<li><a data-str = "' + time + ',' + place + '" data-id = "' + id + '" onclick="liMainMsg(this)" href = "javascript:;" id = "del_yclxBtn">删除 </a></li>');

									if(cf == "是") {
										$("#had_yclxUl").append(li1, li2, li3, li4, li5, li6);
									} else {
										$("#had_yclxUl").append(li1, li2, li3, li6);
									}
									//提醒：从我的位置到“长春市宽城区长春站”
									//REMIND_DATETIME 提醒时间
								}
							}
						} else {
							$.alert("连接超时，请稍后再试", "提示");
						}
					},
					error: function(data) {
						$.alert("连接超时，请稍后再试", "提示");
					}
				});
			});

			//点击灰色的添加按钮
			//			$("#cannotAddBtn").click(function() {

			//			});

			//点击每个li查看已存路线的详情
			function liMainMsg(t) {
				var str = $(t).attr("data-str");
				var str1 = str.split(",")[0];
				var str2 = str.split(",")[1];
				var str = str1 + "出发，去往<span class='alertSpanColGL'>" + str2 + "</span>";
				$.modal({
					title: "<img class='nz_icon' src='img/my/naozhongICON.png'/>我的出行计划",
					text: str,
					buttons: [{
						text: "删除",
						onClick: function() {
							var R = $(t).attr("data-id");
							delYclx(R);
						}
					}, {
						text: "取消",
						onClick: function() {

						}
					}]
				});
			}

			//删除单个预存路线方法
			function delYclx(recid) {
				//修改数据库内容需要加密
				var n1 = recid;
				var allData = "RECID|" + recid;
				allData = encrypt(allData);
				$.ajax({
					type: "post",
					url: Url,
					data: {
						"type": "save_line",
						"DATA": allData
					},
					async: false,
					cache: false,
					dataType: "jsonp", //数据类型为jsonp
					jsonp: "callbackparam", //服务端用于接收callback调用的function名的参数  
					jsonpCallback: "jsonpCallback1",
					success: function(data) {
						if(data.MSG == "成功") {
							$.alert("删除成功！", "提示", function() {
								window.location.reload();
							});
						} else {
							$.alert("连接超时，请稍后再试", "提示");
						}

					},
					error: function(data) {
						$.alert("连接超时，请稍后再试", "提示");
					}
				});
			}

			//点击新增
			$(".app_head_right img").click(function() {
				var ulHtml = $("#had_yclxUl").html();
				if(ulHtml.indexOf("li") == -1) {
					$("#yclx_addArea").slideToggle(300);
					$("body").animate({
						scrollTop: $("body").height()
					}, 300);
				} else {
					$.modal({
						title: "提示",
						text: "如果已存储了预存路线，添加成功后将覆盖前一条，是否删除？",
						buttons: [{
								text: "删除",
								onClick: function() {
									var R = $("#del_yclxBtn").attr("data-id");
									delYclx(R);
								}
							},
							{
								text: "取消",
								onClick: function() {

								}
							}
						]
					});
				}

			});

			//起终点两个input框验证
			function addBtn_yanzheng(t) {
				if($(t).val() != "") {
					$(".mycannotLogin").hide();
					$(".myLogin").show();
				} else {
					$(".mycannotLogin").show();
					$(".myLogin").hide();
				}

			}

			//点击添加按钮
			$("#addToAlert").click(function() {
				$("#yclx_addArea").hide();
			})

			function tanchuScroll(t) { //让弹出框顶部始终保持在手机状态栏之下
				var topVal = t.scrollTop;
				$("#tanchu_head").css("margin-top", topVal);
			}

			//			// 百度地图API功能
			////			function G(id) {
			////				return document.getElementById(id);
			////			}
			var map = new BMap.Map("l-map");
			map.centerAndZoom("长春", 12); // 初始化地图,设置城市和地图级别。
			//			var ac_1 = new BMap.Autocomplete( //建立一个自动完成的对象
			//				{
			//					"input": "suggestId_start",
			//					"location": map
			//				});
			var ac_2 = new BMap.Autocomplete( //建立一个自动完成的对象
				{
					"input": "suggestId_end",
					"location": map
				});

			var myValue;

			//			ac_1.addEventListener("onhighlight", function(e) { //鼠标放在下拉列表上的事件
			//				var str = "";
			//				var _value = e.fromitem.value;
			//				var value = "";
			//				if(e.fromitem.index > -1) {
			//					value = _value.province + _value.city + _value.district + _value.street + _value.business;
			//				}
			//				str = "FromItem<br />index = " + e.fromitem.index + "<br />value = " + value;
			//
			//				value = "";
			//				if(e.toitem.index > -1) {
			//					_value = e.toitem.value;
			//					value = _value.province + _value.city + _value.district + _value.street + _value.business;
			//				}
			//				str += "<br />ToItem<br />index = " + e.toitem.index + "<br />value = " + value;
			//				//				$("#searchResultPanel").innerHTML = str;
			//			});
			//
			//			ac_1.addEventListener("onconfirm", function(e) { //鼠标点击下拉列表后的事件
			//				var _value = e.item.value;
			//				$("#suggestId_start").blur();
			//				myValue = _value.province + _value.city + _value.district + _value.street + _value.business;
			//				//				$("#searchResultPanel").innerHTML = "onconfirm<br />index = " + e.item.index + "<br />myValue = " + myValue;
			//			});

			ac_2.addEventListener("onhighlight", function(e) { //鼠标放在下拉列表上的事件
				var str = "";
				var _value = e.fromitem.value;
				var value = "";
				if(e.fromitem.index > -1) {
					value = _value.province + _value.city + _value.district + _value.street + _value.business;
				}
				str = "FromItem<br />index = " + e.fromitem.index + "<br />value = " + value;

				value = "";
				if(e.toitem.index > -1) {
					_value = e.toitem.value;
					value = _value.province + _value.city + _value.district + _value.street + _value.business;
				}
				str += "<br />ToItem<br />index = " + e.toitem.index + "<br />value = " + value;
				//				$("#searchResultPanel").innerHTML = str;
			});

			ac_2.addEventListener("onconfirm", function(e) { //鼠标点击下拉列表后的事件
				var _value = e.item.value;
				$("#suggestId_end").blur();
				myValue = _value.province + _value.city + _value.district + _value.street + _value.business;
				//				$("#searchResultPanel").innerHTML = "onconfirm<br />index = " + e.item.index + "<br />myValue = " + myValue;

			});

			function setPlace() {
				function myFun() {
					map.centerAndZoom("吉林省长春市", 18);
				}
				//				var local = new BMap.LocalSearch(map, { //智能搜索
				//					onSearchComplete: myFun
				//				});
			}

			function setPlace() {
				map.clearOverlays(); //清除地图上所有覆盖物
				function myFun() {
					var pp = local.getResults().getPoi(0).point; //获取第一个智能搜索的结果
					map.centerAndZoom(pp, 18);
					map.addOverlay(new BMap.Marker(pp)); //添加标注
				}

				var local = new BMap.LocalSearch(map, { //智能搜索
					onSearchComplete: myFun
				});
				local.search(myValue);
			}

			//获取当前时间
			function getNowDate() {
				var date = new Date();
				var y = date.getFullYear();
				var m = date.getMonth() + 1;
				m = m >= 10 ? m : "0" + m;
				var d = date.getDate();
				d = d >= 10 ? d : "0" + d;
				var h = date.getHours();
				h = h >= 10 ? h : "0" + h;
				var min = date.getMinutes();
				min = min >= 10 ? min : "0" + min;
				var s = date.getSeconds();
				s = s >= 10 ? s : "0" + s;
				dateNowStr = y + '-' + m + '-' + d + ' ' + h + ':' + min;
				//				nyrStr = dateNowStr.split(" ")[0];
				//					console.log(dateNowStr);
				return dateNowStr;
			}

			//初始化日期选择器
			$("#datetime-picker").datetimePicker({
				min: getNowDate(), //可选的最大时间为当前时间
				max: "2100-01-01 00:00" //可选最小时间
			});

			var timeFlag = 0;
			//控制单多次提醒开关按钮
			$(".toggle").click(function(e) {
				if(timeFlag == 0) {
					timeFlag = 1;
					$(".cannot").show(); //按钮验证
					$("#addFinishBtn").hide();
					$("#txNum").attr("disabled", false); //两个输入框可输入模式
					$("#spaceTime").attr("disabled", false);
				} else {
					timeFlag = 0;
					if($("#datetime-picker").val() != "") {
						$("#addFinishBtn").show(); //按钮验证
						$(".cannot").hide();
					}
					$("#txNum").val("").attr("disabled", true); //禁填
					$("#spaceTime").val("").attr("disabled", true);
					$(".input2_label").remove(); //点哪个input框显示哪一个的单位（次 或 分钟）
				}
				var toggle = this;

				e.preventDefault();

				$(toggle).toggleClass('toggle--on').toggleClass('toggle--off').addClass('toggle--moving');

				setTimeout(function() {
					$(toggle).removeClass('toggle--moving');
					bgcBottom();

				}, 200);
			});

			function bgcBottom() {
				if($("#KGbtn").hasClass("bgcQGBlue")) {
					$("#KGbtn").removeClass("bgcQGBlue");
				} else {
					$("#KGbtn").addClass("bgcQGBlue");
				}
			}

			//KGbtn点击判断
			//			$("#KGbtn").click(function() {
			//				if($("#datetime-picker").val() == ""&&timeFlag==) {
			//					
			//				}
			//			});

			$("#txNum").picker({
				title: "请选择提醒次数",
				cols: [{
					textAlign: 'center',
					values: ['1', '2', '3', '4', '5', '6', '7', '8', '9', '10']
				}],
				onChange: function() {
					if($("#txNum").next().html().indexOf("次") == -1) {
						var label = $('<label class="input2_label">次</label>');
						$("#txNum").after(label);
					}
					finishBtn();
				}
			});
			$("#spaceTime").picker({
				title: "请选择提醒间隔时间（分钟）",
				cols: [{
					textAlign: 'center',
					values: ['1', '2', '3', '5', '10', '15', '20', '30']
				}],
				onChange: function() {
					if($("#spaceTime").next().html().indexOf("分钟") == -1) {
						var label = $('<label class="input2_label">分钟</label>');
						$("#spaceTime").after(label);
					}
					finishBtn();
				}
			});

			//次数和分钟数输入框onclick事件、
			//			function input2Change(t) {
			//				var Input = document.getElementsByClassName("inputType2");
			//				if(t == Input[0]) {
			//
			//				} else if(t == Input[1]) {
			//
			//				}
			//			}

			//			type = save_line(预存路线)
			//			USERNAME = "用户名"
			//			STARTSTATION = "出发地"--字符串
			//			ENDSTATION = "目的地"--字符串
			//			REMINDTIME = "提醒时长"--整数型
			//			REMINDINTERVAL = "提醒间隔"--整数型
			//			REMINDNUMBER = "提醒次数"--整数型
			//			WHETHERMANY = "是否多次"--布尔型
			//			REMINDDATETIME = "提醒时间"--时间型字符串

			//获取客户端cid
			var clientId = ""; //手机唯一标识
			var token = ""; //(苹果)令牌
			//得到手机标识 方法
			$(document).ready(function() {
				//获取手机唯一标识
				document.addEventListener("plusready", function() {
					// 扩展API加载完毕，现在可以正常调用扩展API
					// 获取客户端标识信息
					setTimeout(function() {
						clientId = plus.push.getClientInfo().clientid;
						token = plus.push.getClientInfo().token;
						//						alert(clientId);
					}, 3000);
				}, false);
			});

			function addYcxl() {
				var timeStr = $("#datetime-picker").val() + ":00";
				
				var flag;
				var n3;//REMINDINTERVAL 提醒间隔
				var n4;//REMINDNUMBER 整数型 提醒次数
				if(timeFlag == 0) {
					//单词提醒
					flag = false;
					n3 = 0;
					n4 = 1
				} else {
					flag = true;
					n3 = $("#spaceTime").val();
					n4 = $("#txNum").val();
				}
				//修改数据库内容 需要加密
				var n1 = "我的位置";
				var n2 = $("#suggestId_end").val(); //ENDSTATION
//				var n3 
//				var n4 
				var n5 = flag; //WHETHERMANY 布尔型
				var n6 = timeStr; //REMINDDATETIME 时间型字符串
				var n7 = clientId; //CID 客户端id
				var n8 = token; //TOKEN 令牌、Ios
				var allData = "USERNAME|" + userName + ",STARTSTATION|" + n1 + ",ENDSTATION|" + n2 + ",REMINDINTERVAL|" + n3 + ",REMINDNUMBER|" + n4 + ",WHETHERMANY|" + n5 + ",REMINDDATETIME|" + n6 + ",CID|" + n7 + ",TOKEN|" + n8;
				allData = encrypt(allData);

				$.ajax({
					type: "post",
					url: Url,
					data: {
						"type": "save_line",
						"DATA": allData
					},
					async: false,
					cache: false,
					dataType: "jsonp", //数据类型为jsonp
					jsonp: "callbackparam", //服务端用于接收callback调用的function名的参数  
					jsonpCallback: "jsonpCallback1",
					success: function(data) {
						//						alert(data);
						if(data.MSG == "成功") {
							$.alert("添加成功", "恭喜您", function() {
								window.location.reload();
							});
						} else {
							$.alert("连接超时，请稍后再试", "提示");
						}

					},
					error: function(data) {
						$.alert("连接超时，请稍后再试", "提示");
					}
				});
			}

			//验证‘完成’按钮
			function finishBtn() {
				if(timeFlag == 0) { //当单次
					$(".cannot").hide();
					$("#addFinishBtn").show();
				} else { //当多次
					if($("#txNum").val() != "" && $("#spaceTime").val() != "") {
						$(".cannot").hide();
						$("#addFinishBtn").show();
					}
				}
			}
		</script>
	</body>

</html>